//package com.ruoyi.system.controller;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.domain.AjaxResult;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.client.RestTemplate;
//
//import javax.annotation.Resource;
//
//@RestController
//@RequestMapping("/system/weather")
//public class MingWeatherController extends BaseController{
//
//    @Resource
//    private RestTemplate restTemplate;
//
//    @PreAuthorize("@ss.hasPermi('system:weather:query')")
//    @GetMapping(value = "/query")
//    public AjaxResult getWeatherInfo(@PathVariable("id") String dizhi)
//    {
////        Map<String, String> vars = Collections.singletonMap("hotel", "42");
//// 通过 GET 方式调用，返回一个 String 值，还可以给 URL 变量设置值（也可通过 uriTemplateHandler 这个属性自定义）
//        String result = restTemplate.getForObject(
//                "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/NanJing/2023-03-03/2023-03-013?key=UTMGKC8975WFQQTPXD4ELQKA3&lang=zh", String.class);
//        JSONObject param = JSONObject.parseObject(result);
//        System.out.println(param.get(""));
//        AjaxResult ajax = AjaxResult.success();
//        ajax.put("myu","ok");
//        return ajax;
//    }
//}
